package com.serviceImpl;

import com.javabean.Permission;
import com.mapper.PermissionMapper;
import com.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionMapper permissionMapper;
    @Override
    public List<Permission> findAll() {
        return permissionMapper.selectAll();
    }

    @Override
    public void add(Permission permission) {
        permissionMapper.insertPermission(permission);
    }

    @Override
    public Permission findById(int id) {
        return permissionMapper.selectById(id);
    }

    @Override
    public void edit(Permission permission) {
        permissionMapper.updatePermission(permission);
    }

    @Override
    public void deleteById(int id) {
        permissionMapper.deleteById(id);
    }

    @Override
    public List<Permission> findByRid(int rid) {
        return permissionMapper.selectByRid(rid);
    }
}
